/**
 * 系统管理 Api
 */
import instance from '@/utils/request'
// import { useUserStore } from '@/stores'

// const store = useUserStore()
const systemPath = {
  getJueSeWeiHu: '/system/common/getDataGrid', // 获取角色维护
  addJueSe: '/system/common/modify', // 添加角色
  getTree: '/system/common/getTree', // 获取树形结构
  getData: '/system/common/getData', // 获取数据
  saveForm: '/system/common/saveForm', // 保存表单
  getSequence: '/system/common/getSequence' // 获取序列
}

export const getJueSeWeiHuApi = (params: any) => {
  return instance({
    url: systemPath.getJueSeWeiHu,
    method: 'post',
    data: params
  })
}

export const addJueSeApi = (params: any) => {
  return instance({
    url: systemPath.addJueSe,
    method: 'post',
    data: params
  })
}

export const getTreeApi = (params: any) => {
  return instance({
    url: systemPath.getTree,
    method: 'post',
    data: params
  })
}

export const getDataApi = (params: any) => {
  return instance({
    url: systemPath.getData,
    method: 'post',
    data: params
  })
}

export const saveFormApi = (params: any) => {
  return instance({
    url: systemPath.saveForm,
    method: 'get',
    params: params
  })
}

export const appSaveFormApi = (params: any) => {
  return instance({
    url: systemPath.saveForm,
    method: 'post',
    data: params
  })
}

export const saveFormPostApi = (params: any) => {
  return instance({
    url: systemPath.saveForm,
    method: 'post',
    data: params
  })
}

export const getSequenceApi = (params: any) => {
  return instance({
    url: systemPath.getSequence,
    method: 'post',
    data: params
  })
}
